package com.team42.lockviewdemo;

import java.util.List;

import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.widget.TextView;

import com.mahao.team42.lockview.widget.LockView;
import com.mahao.team42.lockview.widget.LockView.OnLockFinishListener;

public class MainActivity extends ActionBarActivity implements OnLockFinishListener{

	private TextView console;
	private LockView lockView;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		this.console = (TextView)findViewById(R.id.activity_main_console);
		this.lockView = (LockView)findViewById(R.id.activity_main_lockView);

		//set line color
		this.lockView.setColorLine(Color.RED);
		
		//set circle color
		this.lockView.setColorCircle(Color.GREEN);
		
		//set point color
		this.lockView.setColorPoint(Color.BLUE);
		
		//set column and row count
		this.lockView.setSpanCount(3);
		
		//set min point count to finish
		this.lockView.setMinPointCount(3);
		
		//set inner point circle radius
		this.lockView.setInnerCircleRadius(0.2F);
		
		//set inner trigger circle radius		
		this.lockView.setInnerTriggerCircleRadius(0.8F);
		
		//set outer circle radius
		this.lockView.setOuterCircleRadius(1.0F);
		
		//set set trigger circle show
		this.lockView.setTriggerCircleShow(true);
		
		//set listner
		this.lockView.setOnLockFinishListener(new OnLockFinishListener() {
			@Override
			public void onFinish(List<Integer> result) {
				//TODO
			}
		});
	}

	@Override
	public void onFinish(List<Integer> result) {
		this.console.setText(result.toString());		
	}

}
